
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;

public class GUIDUtil : MonoBehaviour
{
    [ContextMenuItem("To GUID", "PathToGUID"), TextArea]
    public string m_Path;

    [ContextMenuItem("To Path", "GUIDToPath"), TextArea]
    public string m_GUID;

    void PathToGUID()
    {
        m_GUID = string.IsNullOrEmpty(m_Path) ? "" : AssetDatabase.AssetPathToGUID(m_Path);
    }

    void GUIDToPath()
    {
        m_Path = string.IsNullOrEmpty(m_GUID) ? "" : AssetDatabase.GUIDToAssetPath(m_GUID);
    }
}
#endif